<!--大模型选择下拉选择框组件-->

<script setup lang="ts">

const ckpt_nameList = ref<any>([])
const selected = defineModel<number|string>({default: 0})
onMounted(async () => {
  //获取本地支持的大模型
  await ComfyUI.Initalize()
  console.log(ComfyUI.ckpt_names)
  ComfyUI.ckpt_names.forEach((item, index) => {
    const ckpt = {
      value: index,
      name: item
    }
    ckpt_nameList.value.push(ckpt)
  })
})

</script>

<template>
  <v-select clearable variant="underlined" density="compact" v-model="selected" :items="ckpt_nameList"
            item-value="name" item-title="name" label="请选择大模型">
    <template v-slot:selection="{ item }">
      <span class="text-truncate text-no-wrap text-caption">{{ item.title }}</span>
    </template>
    <template v-slot:item="{ props, item }">
      <v-list-item density="compact" nav v-bind="props"></v-list-item>
    </template>
  </v-select>
</template>

<style scoped lang="scss">

</style>